#!/usr/bin/env bash
# Copyright (c) Microsoft. All rights reserved.
# Note: Windows Bash doesn't support shebang extra params
set -e

# Note: use lowercase names for the Docker images
DOCKER_IMAGE="azureiotpcs/device-simulation-dotnet"

APP_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && cd .. && pwd )/"
source "$APP_HOME/scripts/.functions.sh"

run_container() {
    check_dependency_docker

    $APP_HOME/scripts/env-vars-check

    echo "Starting Device Simulation ..."
    docker run --detach -p 9003:9003 \
        -e PCS_KEYVAULT_NAME \
        -e PCS_AAD_APPID \
        -e PCS_AAD_APPSECRET \
        "$DOCKER_IMAGE:DS-1.0.6"
}

run_container
